//
//  KQTextField.m
//  Gxj
//
//  Created by 王奎卿 on 2017/9/15.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "KQTextField.h"

@implementation KQTextField

//控制清除按钮的位置
//-(CGRect)clearButtonRectForBounds:(CGRect)bounds
//{
//    return CGRectMake(bounds.origin.x + bounds.size.width - 50, bounds.origin.y + kHeightScale(15), 16, 16);
//}

//控制placeHolder的位置
- (CGRect)placeholderRectForBounds:(CGRect)bounds
{
    CGRect inset = CGRectMake(bounds.origin.x+kWidthScale(45), bounds.origin.y+kHeightScale(15), bounds.size.width -10, bounds.size.height);
    return inset;
}
//控制显示文本的位置
- (CGRect)textRectForBounds:(CGRect)bounds
{
    CGRect inset = CGRectMake(bounds.origin.x+kWidthScale(45), bounds.origin.y, bounds.size.width - 10, bounds.size.height);
    return inset;
}
//控制编辑文本的位置
- (CGRect)editingRectForBounds:(CGRect)bounds
{
    CGRect inset = CGRectMake(bounds.origin.x + kWidthScale(45), bounds.origin.y, bounds.size.width - 10, bounds.size.height);
    return inset;
}
//控制左视图位置
- (CGRect)leftViewRectForBounds:(CGRect)bounds
{
    CGRect inset = CGRectMake(bounds.origin.x + kWidthScale(10), bounds.origin.y + kHeightScale(10), kWidthScale(15), kHeightScale(25));
    return inset;
}
//控制placeHolder的颜色、字体
- (void)drawPlaceholderInRect:(CGRect)rect
{
    [[UIColor colorWithRed:66.0/255.0 green:167.0/255.0 blue:235.0/255.0 alpha:1] setFill];
    
    [[self placeholder] drawInRect:rect withFont:[UIFont systemFontOfSize:kWidthScale(13)]];
}
@end
